package com.dq.security.controller;

import com.dq.security.entity.User;
import com.dq.security.entity.vo.R;
import com.dq.security.mapper.UserMapper;
import com.dq.security.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * @ClassName UserController
 * @Description 用户层
 * @Author DuX1aoQiang
 * @Date 2023/5/25 11:18
 * @Version 1.0
 */
@RestController
@RequestMapping("user")
public class UserController {
    @Autowired
    private UserService userService;

    @Autowired
    private UserMapper userMapper;

    @GetMapping("test")
    public R test() {
        return R.ok().data("users",userMapper.selectList(null));
    }

    @PostMapping("login")
    public R login(@RequestBody User user) {
        //登录
        return R.ok().data("users",userMapper.selectList(null));
    }
}

